home *** CD-ROM | disk | FTP | other *** search
-
-
-
- GGGGEEEETTTTGGGGRRRREEEENNNNTTTT((((3333CCCC)))) GGGGEEEETTTTGGGGRRRREEEENNNNTTTT((((3333CCCC))))
-
-
-
- NNNNAAAAMMMMEEEE
- getgrent, getgrent_r, getgrgid, getgrgid_r, getgrnam, getgrnam_r,
- setgrent, endgrent, fgetgrent, fgetgrent_r, getgrmember - get group file
- entry
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ggggrrrrpppp....hhhh>>>>
-
- ssssttttrrrruuuucccctttt ggggrrrroooouuuupppp ****ggggeeeettttggggrrrreeeennnntttt((((vvvvooooiiiidddd))));;;;
-
- ssssttttrrrruuuucccctttt ggggrrrroooouuuupppp ****ggggeeeettttggggrrrreeeennnntttt____rrrr((((ssssttttrrrruuuucccctttt ggggrrrroooouuuupppp ****ggggrrrreeeennnntttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee))));;;;
-
- ssssttttrrrruuuucccctttt ggggrrrroooouuuupppp ****ggggeeeettttggggrrrrggggiiiidddd((((ggggiiiidddd____tttt ggggiiiidddd))));;;;
-
- iiiinnnntttt ggggeeeettttggggrrrrggggiiiidddd____rrrr((((ggggiiiidddd____tttt ggggiiiidddd,,,, ssssttttrrrruuuucccctttt ggggrrrroooouuuupppp ****ggggrrrreeeennnntttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee,,,, ssssttttrrrruuuucccctttt ggggrrrroooouuuupppp ********ggggrrrrpppp))));;;;
-
- ssssttttrrrruuuucccctttt ggggrrrroooouuuupppp ****ggggeeeettttggggrrrrnnnnaaaammmm((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****nnnnaaaammmmeeee))));;;;
-
- iiiinnnntttt ggggeeeettttggggrrrrnnnnaaaammmm____rrrr((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****nnnnaaaammmmeeee,,,, ssssttttrrrruuuucccctttt ggggrrrroooouuuupppp ****ggggrrrreeeennnntttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee,,,, ssssttttrrrruuuucccctttt ggggrrrroooouuuupppp ********ggggrrrrpppp))));;;;
-
- vvvvooooiiiidddd sssseeeettttggggrrrreeeennnntttt((((vvvvooooiiiidddd))));;;;
-
- vvvvooooiiiidddd eeeennnnddddggggrrrreeeennnntttt((((vvvvooooiiiidddd))));;;;
-
- ssssttttrrrruuuucccctttt ggggrrrroooouuuupppp ****ffffggggeeeettttggggrrrreeeennnntttt((((FFFFIIIILLLLEEEE ****ffff))));;;;
-
- ssssttttrrrruuuucccctttt ggggrrrroooouuuupppp ****ffffggggeeeettttggggrrrreeeennnntttt____rrrr((((FFFFIIIILLLLEEEE ****ffff,,,, ssssttttrrrruuuucccctttt ggggrrrroooouuuupppp ****ggggrrrreeeennnntttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee))));;;;
-
- iiiinnnntttt ggggeeeettttggggrrrrmmmmeeeemmmmbbbbeeeerrrr((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****nnnnaaaammmmeeee,,,, ggggiiiidddd____tttt ggggiiiidddd____aaaarrrrrrrraaaayyyy[[[[]]]],,,, iiiinnnntttt mmmmaaaaxxxxggggiiiiddddssss,,,, iiiinnnntttt vvvvggggiiiiddddssss))));;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _g_e_t_g_r_e_n_t, _g_e_t_g_r_g_i_d and _g_e_t_g_r_n_a_m and their reentrant counterparts each
- return pointers to an object with the following structure containing the
- broken-out fields of a line in the /_e_t_c/_g_r_o_u_p file or some other back-end
- group database. Each line contains a ``group'' structure, defined in the
- <_g_r_p._h> header file.
-
- struct group {
- char *gr_name; /* the name of the group */
- char *gr_passwd; /* the encrypted group password */
- gid_t gr_gid; /* the numerical group ID */
- char **gr_mem; /* vector of pointers to member names */
- };
-
- _g_e_t_g_r_e_n_t when first called returns a pointer to the first group structure
- in the file; thereafter, it returns a pointer to the next group structure
- in the file; so, successive calls may be used to search the entire file.
- _g_e_t_g_r_g_i_d searches from the beginning of the file until a numerical group
- id matching _g_i_d is found and returns a pointer to the particular
- structure in which it was found. _g_e_t_g_r_n_a_m searches from the beginning of
- the file until a group name matching _n_a_m_e is found and returns a pointer
- to the particular structure in which it was found. If an end-of-file or
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- GGGGEEEETTTTGGGGRRRREEEENNNNTTTT((((3333CCCC)))) GGGGEEEETTTTGGGGRRRREEEENNNNTTTT((((3333CCCC))))
-
-
-
- an error is encountered on reading, these functions return a NULL
- pointer.
-
- The _g_e_t_g_r_n_a_m__r and _g_e_t_g_r_g_i_d__r calls are reentrant versions of the
- _g_e_t_g_r_n_a_m and _g_e_t_g_r_g_i_d calls. The extra arguments grent and buffer are
- used for internal storage, bufsize is size of buffer, and grp is the
- struct group used to return the requested information. A good size of
- buffer is BUFSIZ bytes.
-
- A call to _s_e_t_g_r_e_n_t has the effect of rewinding the group file to allow
- repeated searches. _e_n_d_g_r_e_n_t may be called to close the group file when
- processing is complete.
-
- _f_g_e_t_g_r_e_n_t returns a pointer to the next group structure in the stream _f,
- which matches the format of ////eeeettttcccc////ggggrrrroooouuuupppp.
-
- NNNNOOOOTTTTEEEESSSS
- In IRIX 4.0, there were two versions of the getpwent primitives: the
- standard version in libc and the NIS version in libsun. This release
- contains only routines to parse files, an external file supply mechanism
- nsd(1) supplies data from NIS and other protocols as files. To force
- these routines to not use nsd supplied data set the external
- __g_e_t_p_w_e_n_t__n_o__y_p variable to 1. This is useful for programs that must not
- generate any network traffic, and for programs that update the /_e_t_c/_g_r_o_u_p
- file.
-
-
- _g_e_t_g_r_m_e_m_b_e_r is used to get the ids of the groups of which the given user
- is a member. _n_a_m_e is the name of the user. The group ids are returned
- in the array _g_i_d__a_r_r_a_y which contains _m_a_x_g_i_d_s elements. The first _v_g_i_d
- elements of _g_i_d__a_r_r_a_y are not used by _g_e_t_g_r_m_e_m_b_e_r and can be used by the
- caller to initialize default group ids. _g_e_t_g_r_m_e_m_b_e_r is usually called by
- _i_n_i_t_g_r_o_u_p_s. _g_e_t_g_r_m_e_m_b_e_r returns the number of valid gids in the gid array
- or -1 if an error is encountered.
-
- The Mips ABI specifies nothing but local files so applications which wish
- to use anything else must compile with libc prior to libnsl in the
- library list.
-
- When nsd is running changes in the group file may not be seen by
- getgrent() until the nsd enumeration cache file has timed out.
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- All routines that return a struct group * will return a NULL pointer in
- the case of EOF or failure. The reentrant functions return the errno(3C)
- for the call, and thus 0 implies success. The getgrmember call returns
- the number of gids found, and -1 on failure.
-
- FFFFIIIILLLLEEEESSSS
- /etc/group /var/ns/cache/group.byname.m /var/ns/cache/group.bygid.m
- /var/ns/cache/group.bymember.m
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- GGGGEEEETTTTGGGGRRRREEEENNNNTTTT((((3333CCCC)))) GGGGEEEETTTTGGGGRRRREEEENNNNTTTT((((3333CCCC))))
-
-
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- nsd(1M), getgroups(2), errno(3C), getlogin(3C), getpwent(3C), group(4).
-
- WWWWAAAARRRRNNNNIIIINNNNGGGG
- The above routines use the _s_t_d_i_o library, which causes them to increase
- the size of programs, not otherwise using standard I/O, more than might
- be expected. They also map an external cache file which can cause the
- application to be larger than expected.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-